<?php use \mForge\Helpers\Url; ?>

<div class="container">
    <table>
        <thead>
            <tr>
                <th scope="col">Username</th>
                <th scope="col">Email</th>
                <th scope="col">Created date</th>
                <th scope="col">Last login date</th>
                <th scope="col">Failed login attempts</th>
                <th scope="col">Is locked out</th>
                <th scope="col">Is active</th>
                <th scope="col">Actions</th>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($users as $user): ?>
            <tr>
                <td><?php echo $user->username; ?></td>
                <td><?php echo $user->email; ?></td>
                <td><?php echo $user->createdDate; ?></td>
                <td><?php echo $user->lastLoginDate; ?></td>
                <td><?php echo $user->failedLoginAttempts; ?></td>
                <td><?php echo $user->isLockedOut ? 'Yes' : 'No'; ?></td>
                <td><?php echo $user->isActive ? 'Yes' : 'No'; ?></td>
                <td>
                    <a href="<?php Url::baseUrl() ?>/users/edit/<?php echo $user->id ?>">Edit</a>
                    <a href="<?php Url::baseUrl() ?>/users/delete/<?php echo $user->id ?>">Delete</a>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
</div>
<form action="<?php Url::baseUrl() ?>/users/create" method="get">
    <p>
        <button type="submit">Create new user</button>
    </p>
</form>